package com.glaivelee.tools;

public class StringTool {
	public static String spaceStrClear(String ssc) {
		String space = "&nbsp;";
		if (ssc.startsWith(space)) {
			ssc = ssc.substring(space.length());
		}
		if (ssc.endsWith(space) && (ssc.length() >= space.length())) {
			ssc = ssc.substring(0, ssc.length() - space.length());
		}
		return ssc;
	}

	public static String spaceStrClear(String ssc, String subStr) {
		String space = ("".equals(subStr)) ? "&nbsp;" : subStr;
		if (ssc.startsWith(space)) {
			ssc = ssc.substring(space.length());
		}
		if (ssc.endsWith(space) && (ssc.length() >= space.length())) {
			ssc = ssc.substring(0, ssc.length() - space.length());
		}
		return ssc;
	}
}
